// When color definition differs for dark and light variant,
// it gets @if ed depending on $variant

@import 'color-palette';

@function fade($c) {
  @return mix($c, $grey_900, 50%);
}

// Foreground colors
$dark_fg_color:   rgba($black, 0.87);
$light_fg_color:  $white;
$button_fg_color: if($variant == 'light', rgba($black, 0.62), rgba($white, 0.8)); // extra fg color for raised buttons

$fg_color:                    if($variant == 'light', rgba($black, 0.87), rgba($white, 0.9));
$secondary_fg_color:          if($variant == 'light', rgba($black, 0.54), rgba($white, 0.7));
$hint_fg_color:               if($variant == 'light', rgba($black, 0.38), rgba($white, 0.5));
$disabled_fg_color:           if($variant == 'light', rgba($black, 0.38), rgba($white, 0.5));
$disabled_secondary_fg_color: if($variant == 'light', rgba($black, 0.26), rgba($white, 0.3));
$track_color:                 if($variant == 'light', rgba($black, 0.2), rgba($white, 0.1));
$visit_color:                 if($variant == 'light', rgba($black, 0.16), rgba($white, 0.08));
$divider_color:               if($variant == 'light', rgba($black, 0.12), rgba($white, 0.06));

$titlebar_fg_color:                    if($panel == 'light', rgba($black, 0.87), $white);
$titlebar_secondary_fg_color:          if($panel == 'light', rgba($black, 0.54), rgba($white, 0.7));
$titlebar_hint_fg_color:               if($panel == 'light', rgba($black, 0.38), rgba($white, 0.5));
$titlebar_disabled_fg_color:           if($panel == 'light', rgba($black, 0.38), rgba($white, 0.5));
$titlebar_disabled_secondary_fg_color: if($panel == 'light', rgba($black, 0.26), rgba($white, 0.3));
$titlebar_track_color:                 if($panel == 'light', rgba($black, 0.26), rgba($white, 0.1));
$titlebar_divider_color:               if($panel == 'light', rgba($black, 0.12), rgba($white, 0.06));

$inverse_fg_color:                    rgba($white, 0.85);
$inverse_secondary_fg_color:          rgba($white, 0.7);
$inverse_hint_fg_color:               rgba($white, 0.5);
$inverse_disabled_fg_color:           rgba($white, 0.5);
$inverse_disabled_secondary_fg_color: rgba($white, 0.3);
$inverse_track_color:                 rgba($white, 0.3);
$inverse_divider_color:               rgba($white, 0.15);

// Background colors
$base_color:     if($variant =='dark', #242424, #ffffff);
$alt_base_color: if($variant =='dark', lighten($base_color, 25%), darken($base_color, 25%));

$bg_color:         rgba($black, $middle_opacity);
$alt_bg_color:     rgba($black, $lower_opacity);
$inverse_bg_color: rgba($inverse_fg_color, 0.13);
$keyboard_bg_color:  if($variant == 'light', $grey_50, fade($grey_700)); // for gnome-shell keyboard
$alt_keyboard_bg_color:  if($variant == 'light', $grey_300, fade($grey_900)); // for gnome-shell keyboard

// Misc colors
$primary_color: if($variant == 'light', #315bef, #315bef);
$alt_primary_color: if($variant == 'light', #6887cd, #6887cd);
$accent_color: if($variant == 'light', #315bef, #315bef);

$panel_bg_color: if($trans == 'true', rgba($base_color, 0.8), $base_color);
$panel_fg_color: if($panel == 'dark', #dedede, #242424);
$menu_bg_color: if($trans == 'true', rgba($base_color, 0.95), $base_color);

$link_color:         $primary_color;
$visited_link_color: $purple_A200;

$warning_color: $orange_A700;
$error_color:   $deep_orange_A700;
$success_color: $green_A700;

$suggested_color:   $accent_color;
$destructive_color: $red_A200;

$info_bg_color:     $green_400;
$question_bg_color: $blue_400;
$warning_bg_color:  $orange_400;
$error_bg_color:    $red_400;

$border_color:        if($variant == 'light', rgba($black, 0.12), rgba($white, 0.12));
$highlight_color:     if($variant == 'light', rgba($white, 0.4),  rgba($white, 0.1));
$alt_highlight_color: rgba($white, 0.2);

$borders_bottom_color: if($variant =='light', rgba(black, 0.27), rgba(white, 0.12));
$dark_borders_color:  if($variant =='light', rgba(black, 0.15), rgba(black, 0.35));

// Button colors
$button_bg: if($variant == 'light', white, #656565);
$button_active_top: if($variant == 'light', #7ba3f7, #3d6be3);
$button_active_bottom: if($variant == 'light', #3d6ffc, #3861ca);
$button_active_hover_top: if($variant == 'light', #82a8f7, #3b65e3);
$button_active_hover_bottom: if($variant == 'light', #4675f7, #365cca);

$button_border: $border_color;
$button_bottom_border: $borders_bottom_color;
$button_active_border: #487afa;
$button_active_top_border: #6290f7;
$button_active_bottom_border: #3767fc;

// Button borders and highlights colors
$button_highlight: if($variant == 'light', white, rgba(white, 0.1));

$button_borders: if($variant == 'light', $button_border, $dark_borders_color);
$button_borders_top: if($variant == 'light', $button_border, $dark_borders_color);
$button_borders_bottom: if($variant == 'light', $button_bottom_border, $dark_borders_color);

$button_borders_hover: if($variant == 'light', $button_border, $dark_borders_color);
$button_borders_hover_top: if($variant == 'light', $button_border, $dark_borders_color);
$button_borders_hover_bottom: if($variant == 'light', $button_bottom_border, $dark_borders_color);

$button_borders_active: if($variant == 'light', $button_active_border, $dark_borders_color);
$button_borders_active_top: if($variant == 'light', $button_active_top_border, $dark_borders_color);
$button_borders_active_bottom: if($variant == 'light', $button_active_bottom_border, $dark_borders_color);
